package shell;

/**
 * Message to shell window about what and how should be printed
 * @author Jaromir Lepic
 *
 */
public class OutputMessage {

	private String message;
	private boolean finalMessage;
	private Thread sender;
	private boolean hasSender;
	
	/**
	 * Creates new message
	 * @param message Text to be printed
	 * @param finalMessage True if workind directory should be printed after the text
	 */
	public OutputMessage(String message, boolean finalMessage) {
		this.message = message==null?"":message;
		this.finalMessage = finalMessage;
		this.hasSender = false;
	}
	
	/**
	 * Creates new message with specified sender
	 * @param message Text to be printed
	 * @param finalMessage True if workind directory should be printed after the text
	 * @param sender Sender to be notified of message print
	 */
	public OutputMessage(String message, boolean finalMessage, Thread sender) {
		this.message = message==null?"":message;
		this.finalMessage = finalMessage;
		this.hasSender = true;
		this.sender = sender;
	}
	
	public String getMessage() {
		return message;
	}
	public boolean isFinalMessage() {
		return finalMessage;
	}

	public Thread getSender() {
		return sender;
	}

	public boolean hasSender() {
		return hasSender;
	}
	
	
}
